# -*- codeing = utf-8 -*-
# @Time : 2021/2/22 19:07
# @Atuthor: 朱朱
# @File: 051列表推导式.py
# @Software: PyCharm
nums = [i for i in range(10)]
print(nums)

nums1 = [ i for i in range(10) if i % 2]
print(nums1)

nums3 = [ (x, y) for x in range(5,9) for y in range(10,20)]
print(nums3)

# 请写出一段 Python 代码实现分组一个 list 里面的元素,
# 比如 [1,2,3,...100]变成 [[1,2,3],[4,5,6]....]
nums4 = [i for i in range(1,101)]
print(nums4)

nums5 = [nums4[j:j+3] for j in range(0,100,3)]


